def funA(a):
    print('funA')

def funB(b):
    print('funB')

@funA
@funB
def funC():
    print('funC')
    

#单例模式    
def singleton(cls):  
    instances = {}  
    def getinstance():  
        if cls not in instances:  
            instances[cls] = cls()  
        return instances[cls]  
    return getinstance  
     
@singleton  
class MyClass:
    def __init__(self):
        print('myclass')

a=MyClass()
b=MyClass()


def spamrun(fn):
    def sayspam(*args):
        print("spam,spam,spam")
        fn(*args)
    return sayspam

@spamrun
def useful(a,b):
    print((a*b))  
     
useful(2,5) 